PackageValidator.Validate Method (PackageReader, PackageValidatorSettings)

Validate a package according to specific validation settings.

Parent Type: PackageValidator

Namespace: Microsoft.LearningComponents

Assembly: Microsoft.LearningComponents.dll

Syntax
C#

public static ValidationResults Validate (
PackageReader packageReader,
PackageValidatorSettings packageValidatorSettings

)

Parameters

packageReader

The package to be valdated.

packageValidatorSettings

The PackageValidatorSettings determining which validation rules should be applied during the validation process.

Return Value

A ValidationResults log that contains the warnings and errors encountered during the package validation process.

Exceptions
Exception type Condition
ArgumentNullException

Thrown if the packageReader is null.

InvalidPackageException

Thrown if the validation process encounters errors in the package for which the packageValidatorSettings have a ValidationBehavior value of ValidationBehavior.Enforce.

Remarks

The ValidationResults log will contain the warnings and errors encountered during the package validation process, up to any InvalidPackageException that is thrown during the process, at which time the validation process ends.